<!--添加产品分类-->
<div class="dialog_content">
    <form id="info_form" action="{:U('HotKey/add')}" method="post">
        <table width="100%" class="table_form">
            <tr>
                <th>选择分类 :</th>
                <td>
                    <select class="J_cate_select mr10" data-pid="0" data-uri="{:U('TaobaokeCate/ajax_getchilds')}" data-selected=""></select>
                    <input type="hidden" name="catid" id="J_cate_id" value="" />
                </td>
            </tr>
            <tr>
                <th>关键词 :</th>
                <td>
                    <textarea name="name" id="name" style="width:200px;height:50px;"></textarea>
                  </td>
            </tr>
            <tr>
                <th>
                    链接地址 :
                </th>
                <td><input type="text" name="url" id='url' class="input-text" size="30" /></td>
            </tr>
            <tr>
                <th>热搜 :</th>
                <td>
                    <label><input type="radio" name="hot" value="1"> {:L('yes')}</label>&nbsp;&nbsp;
                    <label><input type="radio" name="hot" value="0" checked> {:L('no')}</label>
                </td>
            </tr>
            <tr>
                <th>启用 :</th>
                <td>
                    <label><input type="radio" name="status" value="1" checked="checked"> {:L('yes')}</label>&nbsp;&nbsp;
                    <label><input type="radio" name="status" value="0"> {:L('no')}</label>
                </td>
            </tr>

        </table>
    </form>
</div>

<script>
    $(function(){
        $('.J_cate_select').cate_select('请选择');
        $.formValidator.initConfig({formid:"info_form",autotip:true});
        $("#name").formValidator({onshow:'填写名称',onfocus:'填写名称'}).inputValidator({min:1,onerror:'填写名称'});

        $('#info_form').ajaxForm({success:complate,dataType:'json'});
        function complate(result){
            if(result.status == 1){
                $.dialog.get(result.dialog).close();
                $.pinphp.tip({content:result.msg});
                window.location.reload();
            } else {
                $.pinphp.tip({content:result.msg, icon:'alert'});
            }
        }


    });
</script>